<?php
return array(
    'router' => array(
        'routes' => array(
            'homeback' => array(
                'type' => 'Zend\Mvc\Router\Http\Literal',
                'options' => array(
                    'route'    => '/backoffice',
                    'defaults' => array(
                        'controller' => 'Backoffice\Controller\Index',
                        'action'     => 'index',
                    ),
                ),
            ),
            // The following is a route to simplify getting started creating
            // new controllers and actions without needing to create a new
            // module. Simply drop new controllers in, and you can access them
            // using the path /application/:controller/:action
            'backoffice' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/backoffice',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Backoffice\Controller',
                        'controller'    => 'Index',
                        'action'        => 'index',
                    ),
                ),
                'may_terminate' => true,
                'child_routes' => array(
                    'default' => array(
                        'type'    => 'Segment',
                        'options' => array(
                            'route'    => '/[:controller[/:action]]',
                            'constraints' => array(
                                'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ),
                            'defaults' => array(
                            ),
                        ),
                    ),
                ),
            ),
            'page' => array(
                'type'    => 'Segment',
                'options' => array(
                    'route'    => '/backoffice/page[/:action][/:id]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Backoffice\Controller\Page',
                        'action'     => 'index',
                    ),
                ),
            ),
            'annonce' => array(
                'type'    => 'Segment',
                'options' => array(
                    'route'    => '/backoffice/annonce[/:action][/:id]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Backoffice\Controller\Annonce',
                        'action'     => 'index',
                    ),
                ),
            ),
            'produitback' => array(
                'type'    => 'Segment',
                'options' => array(
                    'route'    => '/backoffice/produit[/:action][/:id]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Backoffice\Controller\Produit',
                        'action'     => 'index',
                    ),
                ),
            ),
            'utilisateur' => array(
                'type'    => 'Segment',
                'options' => array(
                    'route'    => '/backoffice/utilisateur[/:action][/:id]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Backoffice\Controller\Utilisateur',
                        'action'     => 'index',
                    ),
                ),
            ),
            'boutique' => array(
                'type'    => 'Segment',
                'options' => array(
                    'route'    => '/backoffice/boutique[/:action][/:id]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Backoffice\Controller\Boutique',
                        'action'     => 'index',
                    ),
                ),
            ),
            'categorie' => array(
                'type'    => 'Segment',
                'options' => array(
                    'route'    => '/backoffice/categorie[/:action][/:id]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Backoffice\Controller\Categorie',
                        'action'     => 'index',
                    ),
                ),
            ),
            'userBoutique' => array(
                'type'    => 'Segment',
                'options' => array(
                    'route'    => '/backoffice/user-boutique[/:action][/:id]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Backoffice\Controller\Boutique',
                        'action'     => 'index',
                    ),
                ),
            ),
        ),
    ),
    'service_manager' => array(
        'abstract_factories' => array(
            'Zend\Cache\Service\StorageCacheAbstractServiceFactory',
            'Zend\Log\LoggerAbstractServiceFactory',
        ),
        'aliases' => array(
            'translator' => 'MvcTranslator',
        ),
    ),
    'translator' => array(
        'locale' => 'fr_FR',
        'translation_file_patterns' => array(
            array(
                'type'     => 'gettext',
                'base_dir' => __DIR__ . '/../../Application/language',
                'pattern'  => '%s.mo',
            ),
        ),
    ),
    'controllers' => array(
        'invokables' => array(
            'Backoffice\Controller\Index'   => 'Backoffice\Controller\IndexController',
            'Backoffice\Controller\Page'    => 'Backoffice\Controller\PageController',
            'Backoffice\Controller\Annonce' => 'Backoffice\Controller\AnnonceController',
            'Backoffice\Controller\Produit' => 'Backoffice\Controller\ProduitController',
            'Backoffice\Controller\Utilisateur' => 'Backoffice\Controller\UtilisateurController',
            'Backoffice\Controller\Boutique' => 'Backoffice\Controller\BoutiqueController',
            'Backoffice\Controller\Categorie' => 'Backoffice\Controller\CategorieController',
        ),
    ),
    'view_manager' => array(
        'display_not_found_reason' => true,
        'display_exceptions'       => true,
        'doctype'                  => 'HTML5',
        'not_found_template'       => 'error/404',
        'exception_template'       => 'error/index',
        'template_map' => array(
            'layout/layoutback'           => __DIR__ . '/../view/layout/layout.phtml',
            'backoffice/index/index' => __DIR__ . '/../view/backoffice/index/index.phtml',
        ),
        'template_path_stack' => array(
            __DIR__ . '/../view',
        ),
    ),
    // Placeholder for console routes
    'console' => array(
        'router' => array(
            'routes' => array(
            ),
        ),
    ),
    // doctrine config    
	'doctrine' => array(
		'driver' => array(
			'my_annotation_driver' => array(
			    'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
			    'cache' => 'array',
			    'paths' => array('./module/Backoffice/src/Backoffice/Model/Entity'),
			),
			 'orm_default' => array(
			    'drivers' => array(
			        'Backoffice\Model\Entity' => 'my_annotation_driver'
			    ),
			),
		),
	),
);
